package com.jixuian.rabbitmq.dao;


import com.jixuian.rabbitmq.po.TransMessagePO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface TransMessageDao {

    @Insert("insert into trans_message (id, type, service, exchange, routing_key, queue, sequence, payload, date)" +
            "values(#{id}, #{type}, #{service}, #{exchange}, #{routingKey}, #{queue}, #{sequence}, #{payload}, #{date})")
    void insert(TransMessagePO transMessagePO);

    void update(TransMessagePO transMessagePO);

    TransMessagePO selectByIdAndService(String id, String service);

    List<TransMessagePO> selectByTypeAndService(String type, String service);

    void delete(String id, String service);
}
